Skip to content

Conversation

@HankYuLinksys
Copy link
Collaborator

@HankYuLinksys HankYuLinksys commented Jan 6, 2026

User description

Summary

  • Move core providers and services to lib/core/data/ for better organization
  • Move platform utilities to lib/core/utils/ to centralize platform-specific code

Changes

  • Reorganized core providers and services under lib/core/data/
  • Relocated platform utilities to lib/core/utils/
  • Updated import paths across the codebase

PR Type

Enhancement


Description

  • Move core providers and services to lib/core/data/ directory structure

  • Move platform utilities (assign_ip, ip_getter) to lib/core/utils/

  • Move node_light_settings and wan_external providers to feature-specific locations

  • Update all import paths across 100+ files in lib/ and test/ directories

  • Remove unused mock firmware update provider and empty directories


Diagram Walkthrough

flowchart LR
  A["lib/core/jnap/providers/"] -->|Move| B["lib/core/data/providers/"]
  C["lib/core/jnap/services/"] -->|Move| D["lib/core/data/services/"]
  E["lib/core/jnap/providers/assign_ip/"] -->|Move| F["lib/core/utils/assign_ip/"]
  G["lib/core/jnap/providers/ip_getter/"] -->|Move| H["lib/core/utils/ip_getter/"]
  I["lib/core/jnap/providers/node_light_settings/"] -->|Move| J["lib/page/nodes/providers/"]
  K["lib/core/jnap/providers/wan_external/"] -->|Move| L["lib/page/instant_verify/providers/"]
  B -->|Update imports| M["100+ files"]
  D -->|Update imports| M
  F -->|Update imports| M
  H -->|Update imports| M
  J -->|Update imports| M
  L -->|Update imports| M
Loading

File Walkthrough

Relevant files
Configuration changes
74 files
dashboard_manager_provider.dart
Update imports to new data provider location                         
+3/-3     
device_manager_provider.dart
Update imports to new data provider location                         
+3/-3     
firmware_update_provider.dart
Update imports to new data provider location                         
+3/-3     
node_internet_status_provider.dart
Update imports to new data provider location                         
+1/-1     
polling_provider.dart
Update imports and move node_light_settings reference       
+2/-2     
side_effect_provider.dart
Update location comment and polling provider import           
+2/-2     
dashboard_manager_service.dart
Update imports to new data service location                           
+2/-2     
device_manager_service.dart
Update imports to new data service location                           
+2/-2     
firmware_update_service.dart
Update imports to new data service location                           
+2/-2     
router_repository.dart
Update imports for providers and utilities                             
+5/-5     
usp_mapper_repository.dart
Update side effect provider import path                                   
+1/-1     
devices.dart
Update device manager state import path                                   
+1/-1     
demo_router_repository.dart
Update side effect provider import path                                   
+1/-1     
demo_overrides.dart
Update polling provider import path                                           
+1/-1     
internet_settings_service.dart
Update provider imports to new locations                                 
+2/-2     
internet_settings_view.dart
Update assign_ip utility import path                                         
+2/-2     
release_and_renew_view.dart
Update provider imports to new locations                                 
+2/-2     
local_network_settings_service.dart
Update side effect provider import path                                   
+1/-1     
dhcp_reservations_view.dart
Update device manager state import path                                   
+1/-1     
local_network_settings_view.dart
Update assign_ip utility import path                                         
+2/-2     
dialogs.dart
Update provider imports to new locations                                 
+2/-2     
remote_assistance_dialog.dart
Update polling provider import path                                           
+1/-1     
top_bar.dart
Update device manager provider import path                             
+1/-1     
dashboard_home_provider.dart
Update provider imports to new locations                                 
+2/-2     
dashboard_home_service.dart
Update provider imports to new locations                                 
+2/-2     
home_title.dart
Update provider imports and rename node_wan_status             
+3/-3     
internet_status.dart
Update provider imports and rename node_wan_status             
+2/-2     
networks.dart
Update provider imports and rename node_wan_status             
+4/-4     
port_and_speed.dart
Update provider imports and rename node_wan_status             
+2/-2     
quick_panel.dart
Move node_light_settings to feature location                         
+2/-2     
wifi_grid.dart
Update polling provider import path                                           
+1/-1     
dashboard_home_view.dart
Update provider imports and assign_ip utility                       
+4/-4     
dashboard_menu_view.dart
Update polling provider import path                                           
+1/-1     
prepare_dashboard_view.dart
Update provider imports to new locations                                 
+2/-2     
firmware_update_ui_model.dart
Update device manager state import path                                   
+1/-1     
firmware_update_detail_view.dart
Update firmware update provider import path                           
+1/-1     
firmware_update_process_view.dart
Update device manager state import path                                   
+1/-1     
firmware_update_table.dart
Update device manager state import path                                   
+1/-1     
health_check_provider.dart
Update polling provider import path                                           
+1/-1     
manual_firmware_update_provider.dart
Update provider imports and ip_getter utility                       
+5/-5     
power_table_provider.dart
Update polling provider import path                                           
+1/-1     
timezone_provider.dart
Update polling provider import path                                           
+1/-1     
instant_admin_view.dart
Update provider imports to new locations                                 
+3/-3     
device_filtered_list_provider.dart
Update provider imports to new locations                                 
+2/-2     
device_list_provider.dart
Update provider imports to new locations                                 
+2/-2     
device_list_state.dart
Update device manager state import path                                   
+1/-1     
device_detail_view.dart
Update provider imports to new locations                                 
+2/-2     
devices_filter_widget.dart
Update provider imports to new locations                                 
+2/-2     
instant_device_view.dart
Update provider imports to new locations                                 
+2/-2     
instant_privacy_device_list_provider.dart
Update device manager provider import path                             
+1/-1     
instant_privacy_provider.dart
Update provider imports to new locations                                 
+2/-2     
instant_privacy_service.dart
Update device manager state import path                                   
+1/-1     
instant_safety_service.dart
Update polling provider import path                                           
+1/-1     
pnp_setup_view.dart
Update firmware update provider import path                           
+1/-1     
pnp_service.dart
Update provider imports to new locations                                 
+4/-4     
instant_topology_provider.dart
Update provider imports to new locations                                 
+3/-3     
instant_topology_service.dart
Update device manager state import path                                   
+1/-1     
instant_topology_view.dart
Update provider imports to new locations                                 
+2/-2     
instant_verify_provider.dart
Move wan_external provider to feature location                     
+2/-2     
wan_external_provider.dart
Move wan_external provider to feature location                     
+2/-2     
instant_verify_pdf_service.dart
Update provider imports to new locations                                 
+2/-2     
instant_verify_view.dart
Update provider imports and move wan_external                       
+5/-5     
auto_parent_first_login_provider.dart
Update provider imports to new locations                                 
+2/-2     
auto_parent_first_login_view.dart
Update firmware update provider import path                           
+1/-1     
login_local_view.dart
Update dashboard manager provider import path                       
+1/-1     
add_nodes_provider.dart
Update provider imports to new locations                                 
+2/-2     
add_nodes_state.dart
Update device manager state import path                                   
+1/-1     
add_wired_nodes_provider.dart
Update provider imports to new locations                                 
+3/-3     
add_wired_nodes_state.dart
Update device manager state import path                                   
+1/-1     
node_detail_provider.dart
Update provider imports to new locations                                 
+2/-2     
node_light_settings_provider.dart
Move node_light_settings provider to feature location       
+1/-1     
node_detail_service.dart
Update device manager state import path                                   
+1/-1     
add_nodes_view.dart
Update device manager state import path                                   
+1/-1     
node_detail_view.dart
Update provider imports and move node_light_settings         
+5/-5     
Miscellaneous
1 files
mock_firmware_update_provider.dart
Remove unused mock firmware update provider file                 
+0/-166 
Additional files
80 files
linksys_cloud_repository.dart +3/-3     
linksys_device_cloud_service.dart +4/-4     
geolocation_provider.dart +2/-2     
remote_client_provider.dart +1/-1     
dashboard_manager_state.dart [link]   
device_manager_state.dart [link]   
firmware_update_state.dart [link]   
polling_service.dart [link]   
base_assign_ip.dart [link]   
web_assign_ip.dart [link]   
get_local_ip.dart [link]   
mobile_get_local_ip.dart [link]   
web_get_local_ip.dart [link]   
wan_external_state.dart [link]   
wan_external_service.dart [link]   
node_light_settings_service.dart [link]   
vpn_status_tile.dart +1/-1     
channelfinder_provider.dart +1/-1     
wifi_bundle_provider.dart +2/-2     
channel_finder_service.dart +1/-1     
wifi_settings_service.dart +1/-1     
auth_provider.dart +3/-3     
router_provider.dart +5/-5     
test_helper.dart +9/-9     
dashboard_manager_provider_test.dart +4/-4     
dashboard_manager_state_test.dart +1/-1     
device_manager_provider_test.dart +4/-4     
device_manager_state_test.dart +1/-1     
firmware_update_provider_test.dart +5/-5     
node_light_settings_provider_test.dart +2/-2     
polling_provider_test.dart +2/-2     
wan_external_provider_test.dart +3/-3     
wan_external_state_test.dart +1/-1     
dashboard_manager_service_test.dart +3/-3     
device_manager_service_test.dart +2/-2     
firmware_update_service_test.dart +3/-3     
node_light_settings_service_test.dart +1/-1     
polling_service_test.dart +1/-1     
wan_external_service_test.dart +1/-1     
add_nodes_notifier_mocks.dart +1/-1     
dashboard_home_notifier_mocks.dart +2/-2     
dashboard_manager_notifier_mocks.dart +3/-3     
device_list_notifier_mock.dart +1/-1     
device_manager_notifier_mocks.dart +3/-3     
firmware_update_notifier_mocks.dart +2/-2     
firmware_update_service_mocks.dart +1/-1     
geolocation_notifier_mocks.dart +1/-1     
dashboard_manager_notifier_spec.dart +1/-1     
device_manager_notifier_spec.dart +1/-1     
firmware_update_notifier_spec.dart +1/-1     
firmware_update_service_spec.dart +1/-1     
node_light_settings_notifier_spec.dart +1/-1     
polling_notifier_spec.dart +1/-1     
side_effect_notifier_spec.dart +1/-1     
node_detail_notifier_mocks.dart +1/-1     
node_light_settings_notifier_mocks.dart +1/-1     
polling_notifier_mocks.dart +1/-1     
router_repository_mocks.dart +1/-1     
side_effect_notifier_mocks.dart +1/-1     
dashboard_home_test_data.dart +2/-2     
dashboard_manager_test_data.dart +1/-1     
device_manager_test_data.dart +1/-1     
instant_privacy_test_data.dart +1/-1     
internet_settings_service_test.dart +1/-1     
dashboard_home_view_test.dart +3/-3     
dashboard_home_provider_test.dart +4/-4     
firmware_update_detail_view_test.dart +1/-1     
health_check_provider_test.dart +1/-1     
manual_firmware_update_provider_test.dart +2/-2     
instant_privacy_provider_test.dart +2/-2     
instant_topology_provider_test.dart +1/-1     
instant_verify_provider_test.dart +3/-3     
instant_verify_view_test.dart +1/-1     
node_detail_view_test.dart +1/-1     
node_detail_provider_test.dart +2/-2     
add_nodes_view_test.dart +1/-1     
wifi_bundle_provider_test.dart +4/-4     
wifi_settings_service_test.dart +1/-1     
auth_provider_test.dart +3/-3     
firmware_update_test_state.dart +1/-1     

- Move assign_ip/ folder from lib/core/jnap/providers/ to lib/core/utils/
- Move ip_getter/ folder from lib/core/jnap/providers/ to lib/core/utils/
- Update import paths in all affected files (8 files)
- Remove unused mock_firmware_update_provider.dart from lib/
- Create new lib/core/data/ directory structure with providers/ and services/ subdirectories
- Move dashboard_manager_provider/state from lib/core/jnap/providers/ to lib/core/data/providers/
- Move device_manager_provider/state from lib/core/jnap/providers/ to lib/core/data/providers/
- Move firmware_update_provider/state from lib/core/jnap/providers/ to lib/core/data/providers/
- Move polling_provider from lib/core/jnap/providers/ to lib/core/data/providers/
- Move side_effect_provider from lib/core/jnap/providers/ to lib/core/data/providers/
- Move node_wan_status_provider to lib/core/data/providers/node_internet_status_provider.dart
- Move dashboard_manager_service from lib/core/jnap/services/ to lib/core/data/services/
- Move device_manager_service from lib/core/jnap/services/ to lib/core/data/services/
- Move firmware_update_service from lib/core/jnap/services/ to lib/core/data/services/
- Move polling_service from lib/core/jnap/services/ to lib/core/data/services/
- Update all import paths in lib/ and test/ directories
- Remove empty lib/core/jnap/providers/ and lib/core/jnap/services/ directories
@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
decouple data layer from UI

To maintain clean architecture, move node_light_settings_provider from the page
layer to the core/data layer, as the data layer should not depend on the UI
layer.

lib/core/data/providers/polling_provider.dart [8]

-import 'package:privacy_gui/page/nodes/providers/node_light_settings_provider.dart';
+import 'package:privacy_gui/core/data/providers/node_light_settings_provider.dart';
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies an architectural layering violation where the data layer (core/data) depends on the UI layer (page/). Fixing this improves maintainability and adheres to clean architecture principles.

Medium
decouple utils from provider state

Decouple core/utils from provider state by removing the import of
device_manager_state.dart and passing any required state directly into the
extension methods.

lib/core/utils/devices.dart [3]

-import 'package:privacy_gui/core/data/providers/device_manager_state.dart';
+// (remove) import 'package:privacy_gui/core/data/providers/device_manager_state.dart';
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly points out that utility extensions should be decoupled from provider state for better modularity and testability. This is a good practice for improving code architecture.

Low
  • More

Copy link
Collaborator

@AustinChangLinksys AustinChangLinksys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@AustinChangLinksys AustinChangLinksys merged commit 12dd500 into dev-2.0.0 Jan 6, 2026
2 checks passed
@AustinChangLinksys AustinChangLinksys deleted the refactor/move-core-providers-and-utils branch January 6, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants